xen/list: Remove prefetching
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Jan 2020 19:54:04 +0000 (19:54 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Jan 2020 15:16:23 +0000 (15:16 +0000)
commit8142e165f4370cb9d24af16e14259b879736e7c7
tree0c7c1a065bebdb596b1499bed0325730ae77b488
parent035c4d771600f300382a1637f2da33023f76b4c1
xen/list: Remove prefetching

Xen inherited its list infrastructure from Linux.  One area where has fallen
behind is that of prefetching, which as it turns out is a performance penalty
in most cases.

Prefetch of NULL on x86 is now widely measured to have glacial performance
properties, and will unconditionally hit on every hlist use due to the
termination condition.

Cross-port the following Linux patches:

  75d65a425c (2011) "hlist: remove software prefetching in hlist iterators"
  e66eed651f (2011) "list: remove prefetching from regular list iterators"
  c0d15cc7ee (2013) "linked-list: Remove __list_for_each"

to Xen, which results in the following net diffstat on x86:

  add/remove: 0/1 grow/shrink: 27/83 up/down: 576/-1648 (-1072)

(The code additions comes from a few now-inlined functions, and slightly
different basic block padding.)

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <julien@xen.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/include/xen/list.h